import request from '@/utils/request'

// 获取所有订单列表 
export const findAllOrders = () => {
    return request.get(`/lejuClient/order/findAllOrders`)
}

// 获取售后数据
export const orderReturnApplys = () => {
    return request.get(`/lejuClient/orderReturn/orderReturnApplys`)
}

// 取消订单
export const cancelOrder = (orderId: string) => {
    return request.post(`/lejuClient/order/cancelOrder/${orderId}`)
}

// 付款
export const payConfirm = (data: any) => {
    return request.post(`/lejuClient/order/payConfirm`, data)
}

// 根据 id 获取订单明细
export const getPreOrderById = (orderId: string) => {
    return request.get(`/lejuClient/order/getPreOrderById/${orderId}`)
}

// 提交确认订单
export const addConfirmOrder = (orderInfoVo: object) => {
    return request.post(`/lejuClient/order/addConfirmOrder`, orderInfoVo)
}

// 确认收货
export const receiveDone = (data: object) => {
    return request.post(`/lejuClient/order/receiveDone`, data)
}

// 删除订单
export const deleteOrder = (orderId: string) => {
    return request.delete(`/lejuClient/order/deleteOrder/${orderId}`)
}

// 强制删除订单
export const clearOrderFocus = (orderId: string) => {
    console.log(orderId)
    return request.post(`/lejuClient/order/_clearOrderFocus?orderId=${orderId}`)
}
//退货地址列表
export const getBackAdressList=()=>{
    return request.get('/lejuClient/orderReturn/getCompanyAddrss')
}
//退单图片上传
export const uploadImg=(data:any)=>{
    return request.post('/lejuClient/orderReturn/uploadImg',data)
}
//申请退单
export const orderApply=(data:any)=>{
    return request.post('/lejuClient/orderReturn/addOrderReturnApply',data)
}

 
